<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <%--${company_name}   company_logo--%>
    <title>登录</title>
        <script>
            var p_path="<%=request.getContextPath()%>";
        </script>
    <meta charset="utf-8">
    <!--[if lt IE 9]><script src="${resourcePath}/js/comm/css3-mediaqueries.js"></script><![endif]-->
    <script type="text/javascript" src=<c:url value ="/js/comm/jquery-1.9.0.min.js"/> ></script>
    <script type="text/javascript" src=<c:url value ="/js/comm/jquery-migrate-1.2.1.min.js"/> ></script>
    <script type="text/javascript" src=<c:url value ="/js/table/jquery.cookie.js"/> ></script>
    <script type="text/javascript" src=<c:url value ="/js/comm/jquery.blockUI.min.js"/> ></script>
    <script type="text/javascript" src=<c:url value ="/js/comm/myutil.js"/>> </script>
    <script type="text/javascript" src=<c:url value ="/js/comm/commonBase.js"/>> </script>
    <script type="text/javascript" src=<c:url value ="/js/crypjs/core-min.js"/> ></script>
    <script type="text/javascript" src=<c:url value ="/js/crypjs/aes.js"/> ></script>
    <script type="text/javascript" src=<c:url value ="/js/crypjs/login.js"/> ></script>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="${resourcePath}/css/comm/base_v3.0.css">
</head>
<body>
<div class="login-left">
    <img title="${company_name}" src="${company_logo}" alt="" class="img0"/>
    <img src="${resourcePath}/images/comm/lbg-1.png" alt="" class="img1"/>
    <img src="${resourcePath}/images/comm/lb.png" alt="" class="img2"/>
</div>
<div class="login-right">
    <div class="input-login">
        <p class="p-welcome"><img src="${resourcePath}/images/comm/logo.png" alt=""/></p>
        <form id="login">
        <div class="user-input clearFix">
            <em class="em0"></em>
            <input name="userName" type="text" placeholder="请输入用户名"/>
        </div>
        <div class="user-input clearFix password">
            <em class="em1"></em>
            <input name="pwd"  type="password" placeholder="请输入密码"/>
        </div>
        </form>
        <div class="auto">
            <span class="on-off"><em id="checkedmeI" onclick="checkedme(this)"></em><i>记住密码</i></span>
            <a href="">忘记密码？</a>
        </div>
        <a class="lo-btn" onclick="login()" href="javascript:void(0)"></a>
    </div>
    <div class="phone-address">
        <p class="com-phone">电话:028-6888695&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;邮箱:service@deyuanyun.com</p>
        <p class="com-address">公司地址：四川省成都市高新区天益街38#理想中心3栋1208</p>
    </div>
</div>

</body>
    <script type="text/javascript">
    var _token="";
    function login (){
        $().invoke(
                "<%=request.getContextPath()%>/login.json",
                $("#login").serialize(),
                function(m,r){
                    if (r=='loginSuccess'){
                        var c=$("#checkedmeI").hasClass("active");
                        if (c){
                            setUserInfoCookies();
                        }
                        localStorage.setItem("_nowPage_url_CacheName","");
                        localStorage.setItem("_nowPage_tab_CacheName","");
                        top.location="<%=request.getContextPath()%>"+"/pipe/pipeIndex.html";
                    }
                }
        )
    }
    $(function(){
        var $Bh=$(window).height()
        $('.login-left').css({height:$Bh})
        $('.login-right').css({height:$Bh})
        $('.auto .on-off em').on('click',function(){
            $(this).hasClass('active') ? $(this).removeClass('active') : $(this).addClass('active')
        })
        $('.user-input input').focus(function(){
            $(this).parent().addClass('active');
            $(this).parent().css({"backgroundColor":"#ffffff"})
        })
        $('.user-input input').blur(function(){
            $(this).parent().removeClass('active');
            $(this).parent().css({"backgroundColor":"#f0f2f5"})
        })
    })


    $(document).ready(function(){
        if(top.location!=self.location){
            top.location="<%=request.getContextPath()%>"+"/index.html";
            return;
        }
        readUserInfoCookies();
    });

    document.onkeydown=function(event){
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if(e && e.keyCode==13){ // enter 键
            login();
        }
    };
</script>
</html>